package com.hsgene.goods.dto;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.hsgene.common.util.date.TimeJsonDeserializer;
import com.hsgene.goods.constants.GoodsMallStatus;
import com.hsgene.goods.domain.GoodsMall;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 商城商品信息Dto
 *
 * @author wangbing
 * @version 1.0, 2018/7/14
 */
public class GoodsMallItemDto implements Serializable {

    private static final long serialVersionUID = -721535043148964458L;
    /**
     * 商城商品编号
     */
    private String id;

    /**
     * 商品编号
     */
    private String goodsId;

    /**
     * 供应商名称
     */
    private String supplierName;

    /**
     * 套餐名称
     */
    private String goodsName;

    /**
     * 结算价格
     */
    private BigDecimal settlementPrice;

    /**
     * 状态：待完善、待发布、已发布、修改申请中、上架中、已下架
     */
    private Integer status;

    /**
     * 状态描述
     */
    private String statusDesc;

    /**
     * 创建时间
     */
    @JsonDeserialize(using = TimeJsonDeserializer.class)
    private Date createTime;

    /**
     * 更新时间
     */
    @JsonDeserialize(using = TimeJsonDeserializer.class)
    private Date updateTime;

    public GoodsMallItemDto() {
    }

    public GoodsMallItemDto(GoodsMall mall) {
        BeanUtils.copyProperties(mall, this);
        if (this.status != null) {
            this.statusDesc = GoodsMallStatus.getEnum(this.status).getDesc();
        }
    }

    public String getStatusDesc() {
        return statusDesc;
    }

    public void setStatusDesc(String statusDesc) {
        this.statusDesc = statusDesc;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(String goodsId) {
        this.goodsId = goodsId;
    }

    public String getSupplierName() {
        return supplierName;
    }

    public void setSupplierName(String supplierName) {
        this.supplierName = supplierName;
    }

    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public BigDecimal getSettlementPrice() {
        return settlementPrice;
    }

    public void setSettlementPrice(BigDecimal settlementPrice) {
        this.settlementPrice = settlementPrice;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
}
